{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import xgboost as xgb"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "rng = np.random.RandomState(1994)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "dtrain = xgb.DMatrix('agaricus.txt.train')\n",
    "dtest = xgb.DMatrix('agaricus.txt.test')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 使用 GBLinear作为booster"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "params = {'silent': 1, 'objective': 'binary:logistic',\n",
    "          'booster': 'gblinear', 'alpha': 0.0001, 'lambda': 1}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "watchlist = [(dtest, 'eval'), (dtrain, 'train')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "num_boost_round = 4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\teval-error:0.019863\ttrain-error:0.015047\n",
      "[1]\teval-error:0.005587\ttrain-error:0.00476\n",
      "[2]\teval-error:0\ttrain-error:0.001842\n",
      "[3]\teval-error:0\ttrain-error:0.000614\n"
     ]
    }
   ],
   "source": [
    "bst = xgb.train(params, dtrain, num_boost_round, watchlist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "preds = bst.predict(dtest)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 使用 DART(Dropout + Gradient Boosting) 作为booster"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "params = {'max_depth': 5, 'objective': 'binary:logistic', 'booster': 'dart', 'silent': 1}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "watchlist = [(dtest, 'eval'), (dtrain, 'train')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "num_boost_round = 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\teval-error:0\ttrain-error:0.000614\n",
      "[1]\teval-error:0\ttrain-error:0.001228\n",
      "[2]\teval-error:0\ttrain-error:0.000614\n",
      "[3]\teval-error:0\ttrain-error:0.000614\n",
      "[4]\teval-error:0\ttrain-error:0\n"
     ]
    }
   ],
   "source": [
    "bst = xgb.train(params, dtrain, num_boost_round, watchlist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "preds = bst.predict(dtest, ntree_limit=num_boost_round)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "labels = dtest.get_label()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.0\n"
     ]
    }
   ],
   "source": [
    "print sum(1 for i in range(len(preds)) if int(preds[i] > 0.5) != labels[i]) / float(len(preds))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "params['learning_rate'] = 0.1\n",
    "params['rate_drop'] = 0.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "preds_list = []"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\teval-error:0\ttrain-error:0.000614\n",
      "[1]\teval-error:0\ttrain-error:0.001228\n",
      "[2]\teval-error:0\ttrain-error:0.001228\n",
      "[3]\teval-error:0\ttrain-error:0.001228\n",
      "[4]\teval-error:0\ttrain-error:0.001228\n",
      "[0]\teval-error:0\ttrain-error:0.000614\n",
      "[1]\teval-error:0\ttrain-error:0.001228\n",
      "[2]\teval-error:0\ttrain-error:0.001228\n",
      "[3]\teval-error:0\ttrain-error:0.001228\n",
      "[4]\teval-error:0\ttrain-error:0.001228\n",
      "[0]\teval-error:0\ttrain-error:0.000614\n",
      "[1]\teval-error:0\ttrain-error:0.001228\n",
      "[2]\teval-error:0\ttrain-error:0.001228\n",
      "[3]\teval-error:0\ttrain-error:0.001228\n",
      "[4]\teval-error:0\ttrain-error:0.001228\n",
      "[0]\teval-error:0\ttrain-error:0.000614\n",
      "[1]\teval-error:0\ttrain-error:0.001228\n",
      "[2]\teval-error:0\ttrain-error:0.001228\n",
      "[3]\teval-error:0\ttrain-error:0.001228\n",
      "[4]\teval-error:0\ttrain-error:0.001228\n"
     ]
    }
   ],
   "source": [
    "for p in [[p0, p1] for p0 in ['uniform', 'weighted'] for p1 in ['tree', 'forest']]:\n",
    "    params['sample_type'] = p[0]\n",
    "    params['normalize_type'] = p[1]\n",
    "    bst = xgb.train(params, dtrain, num_boost_round, watchlist)\n",
    "    preds = bst.predict(dtest, ntree_limit=num_boost_round)\n",
    "    err = sum(1 for i in range(len(preds)) if int(preds[i] > 0.5) != labels[i]) / float(len(preds))\n",
    "    preds_list.append(preds)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 参数eta(shrinkage)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "watchlist = [(dtest, 'eval'), (dtrain, 'train')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "num_boost_round = 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "params = {'max_detph': 2, 'eta': 0, 'silent': 1, 'objective': 'binary:logistic'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "evals_result ={}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\teval-error:0\ttrain-error:0.000614\n",
      "[1]\teval-error:0\ttrain-error:0.000614\n",
      "[2]\teval-error:0\ttrain-error:0\n",
      "[3]\teval-error:0\ttrain-error:0\n",
      "[4]\teval-error:0\ttrain-error:0\n"
     ]
    }
   ],
   "source": [
    "# 将eta设置为0，看看学习率是否起作用, 为每一次迭代过程设置学习率\n",
    "bst = xgb.train(params, dtrain, num_boost_round, watchlist, learning_rates=[0.8, 0.7, 0.6, 0.5, 0.4],\n",
    "                evals_result=evals_result) #evals_result保存每一次迭代的计算结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "eval_erros = list(map(float, evals_result['eval']['error']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.0\n",
      "0.0\n",
      "0.0\n",
      "0.0\n",
      "0.0\n"
     ]
    }
   ],
   "source": [
    "for err in eval_erros:\n",
    "    print err"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 将learning_rate设置为0，看看learning_rate是否起作用\n",
    "params = {'max_depth': 2, 'learning_rate': 0, 'silent': 1, 'objective': 'binary:logistic'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "evals_result = {}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\teval-error:0.042831\ttrain-error:0.046522\n",
      "[1]\teval-error:0.036623\ttrain-error:0.037617\n",
      "[2]\teval-error:0.015518\ttrain-error:0.013358\n",
      "[3]\teval-error:0.027312\ttrain-error:0.021495\n",
      "[4]\teval-error:0.021105\ttrain-error:0.015661\n"
     ]
    }
   ],
   "source": [
    "bst = xgb.train(params, dtrain, num_boost_round, watchlist, learning_rates=[0.8, 0.7, 0.6, 0.5, 0.4],\n",
    "                evals_result=evals_result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "eval_erros = list(map(float, evals_result['eval']['error']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.042831\n",
      "0.036623\n",
      "0.015518\n",
      "0.027312\n",
      "0.021105\n"
     ]
    }
   ],
   "source": [
    "# 错误在减小，起作用了\n",
    "for error in eval_erros:\n",
    "    print error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "params = {'max_depth': 2, 'silent': 1, 'objective': 'binary:logistic'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "evals_result = {}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\teval-error:0.481688\ttrain-error:0.482113\n",
      "[1]\teval-error:0.481688\ttrain-error:0.482113\n",
      "[2]\teval-error:0.481688\ttrain-error:0.482113\n",
      "[3]\teval-error:0.481688\ttrain-error:0.482113\n",
      "[4]\teval-error:0.481688\ttrain-error:0.482113\n"
     ]
    }
   ],
   "source": [
    "bst = xgb.train(params, dtrain, num_boost_round, watchlist, learning_rates=[0,0,0,0,0],\n",
    "                evals_result=evals_result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "eval_errors = list(map(float, evals_result['eval']['error']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.481688\n",
      "0.481688\n",
      "0.481688\n",
      "0.481688\n",
      "0.481688\n"
     ]
    }
   ],
   "source": [
    "# 学习率为0， 模型不照\n",
    "for error in eval_errors:\n",
    "    print error"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 自定义衰减函数作为learning_rates"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 使用自定义衰减函数作为learning_rates\n",
    "def eta_decay(ithround, num_boost_round):\n",
    "    return num_boost_round / (ithround + 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\teval-error:0.042831\ttrain-error:0.046522\n",
      "[1]\teval-error:0.042831\ttrain-error:0.046522\n",
      "[2]\teval-error:0.042831\ttrain-error:0.046522\n",
      "[3]\teval-error:0.042831\ttrain-error:0.046522\n",
      "[4]\teval-error:0.042831\ttrain-error:0.046522\n"
     ]
    }
   ],
   "source": [
    "bst = xgb.train(params, dtrain, num_boost_round, watchlist, learning_rates=eta_decay)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 自定义损失函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "params = {'max_depth': 2, 'eta': 1, 'silent': 1}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "watchlist = [(dtest, 'eval'), (dtrain, 'train')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "num_boost_round = 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 返回梯度和Hess矩阵\n",
    "def logregobj(preds, dtrain):\n",
    "    labels = dtrain.get_label()\n",
    "    preds = 1.0 / (1.0 + np.exp(-preds))\n",
    "    grad = preds - labels\n",
    "    hess = preds * (1.0 - preds)\n",
    "    return grad, hess"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def evalerror(preds, dtrain):\n",
    "    labels = dtrain.get_label()\n",
    "    return 'error', float(sum(labels != (preds > 0.0))) / len(labels)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\teval-error:0.042831\ttrain-error:0.046522\n",
      "[1]\teval-error:0.021726\ttrain-error:0.022263\n"
     ]
    }
   ],
   "source": [
    "bst = xgb.train(params, dtrain, num_boost_round, watchlist, logregobj, evalerror)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "preds = bst.predict(dtest)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "labels = dtest.get_label()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>test-error-mean</th>\n",
       "      <th>test-error-std</th>\n",
       "      <th>train-error-mean</th>\n",
       "      <th>train-error-std</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.055760</td>\n",
       "      <td>0.015827</td>\n",
       "      <td>0.050691</td>\n",
       "      <td>0.009194</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.021198</td>\n",
       "      <td>0.003813</td>\n",
       "      <td>0.021313</td>\n",
       "      <td>0.002075</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   test-error-mean  test-error-std  train-error-mean  train-error-std\n",
       "0         0.055760        0.015827          0.050691         0.009194\n",
       "1         0.021198        0.003813          0.021313         0.002075"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 结合交叉验证\n",
    "xgb.cv(params, dtrain, num_boost_round, nfold=5, seed=0,\n",
    "       obj=logregobj, feval=evalerror)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 测试train()中maximize 参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def neg_evalerror(preds, dtrain):\n",
    "    labels = dtrain.get_label()\n",
    "    return 'error', float(sum(labels == (preds > 0.0))) / len(labels)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\teval-error:0.957169\ttrain-error:0.953478\n",
      "[1]\teval-error:0.978274\ttrain-error:0.977737\n"
     ]
    }
   ],
   "source": [
    "bst2 = xgb.train(params, dtrain, num_boost_round, watchlist, logregobj, neg_evalerror, maximize=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "preds = bst2.predict(dtest)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 同时使用多个评价指标"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "watchlist = [(dtest, 'eval'), (dtrain, 'train')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "params = {'max-depth': 2, 'eta': 0.2, 'silent': 1, 'objective': 'binary:logistic'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "params['eval_metric'] = ['auc', 'logloss', 'error']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "evals_result = {}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\teval-auc:1\teval-logloss:0.514188\teval-error:0\ttrain-auc:0.999238\ttrain-logloss:0.514426\ttrain-error:0.000614\n",
      "[1]\teval-auc:1\teval-logloss:0.393842\teval-error:0\ttrain-auc:0.999238\ttrain-logloss:0.39443\ttrain-error:0.001228\n"
     ]
    }
   ],
   "source": [
    "bst = xgb.train(params, dtrain, num_boost_round, watchlist, evals_result=evals_result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(evals_result['eval'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
